<script>
    var s = localStorage.getItem("admin");
    var role = localStorage.getItem("role_id");
    var admin = null;
    if(role!=null){
        admin = JSON.parse(s);
        console.log(admin)
        console.log(admin.username)
        $("#USERNAME").text(admin.username+"-"+role);
    }else if(s){
        //取admin里面的值得转为JSON，用JSON.parse(s)
        admin = JSON.parse(s);
        console.log(admin)
        console.log(admin.username)
        $("#USERNAME").text(admin.username);
    }else{
        location.href = "login.html";
    }
    $("#BtnLoginOut").click(function(){
        localStorage.removeItem("admin");
        localStorage.removeItem("role_id");
        admin = null;
        location.href = "login.html";
    })
    $(document.body).css({
        "overflow-x":"hidden",
        "overflow-y":"hidden"
    });
    $("#imgtoIndex").click(function(){
        location.href="index.html";
    })

</script>
<div class="row" style="height:80px">
<div class="col-md-1">
    <img src="images/logo/logo3.png" id="imgtoIndex" width="60px" style="border-radius: 100%;margin-top:10px;margin-left:50px">
</div>
<div class="col-md-5">
    <h3 style="line-height: 40px">梳碧湖驾校预约管理系统</h3>
</div>
<div class="col-md-4"></div>
<div class="col-md-2 text-right">
    <!-- 页头 -->
    <div class="btn-group" style="margin-top:15px">
        <button id="btnhead"style="border:0;font-size:18px" class="btn btn-default dropdown-toggle"
                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <span class="glyphicon glyphicon-user"></span> <span id="USERNAME"></span> <span class="glyphicon glyphicon glyphicon-menu-down"></span> </span>
        </button>
        <ul class="dropdown-menu">

            <li><a href="#" id="BtnLoginOut">安全退出</a></li>
        </ul>
    </div>

</div>
</div>